	package model;

import java.util.*;

public class Card {
	public String name;//name of a city card, or name of the event for a chance or a community chest.
	public static ArrayList<City>deckCity;
	ArrayList<Card>deckChance;
	ArrayList<Card>deckCommunity_chest;

	public Card(){
	}

	public void build_cards(){
		City city = new City();
		Chance chance = new Chance();
		Community_chest com = new Community_chest();
		deckCity=city.build_deck();
		deckChance=chance.build_deck();
		deckCommunity_chest=com.build_deck();
	}

	//this method will mix the cards
	public ArrayList<Card> mix(ArrayList<Card> deck){
		Collections.shuffle(deck);
		return deck;
	}

	//method for pick a card (method fifo)
	public Card pick(String kind_card){
		if(kind_card.equals("Chance")){
			Card c = deckChance.get(0);
			deckChance.add(c);
			return deckChance.remove(0); 
		}
		else {
			Card c = deckCommunity_chest.get(0);
			deckCommunity_chest.add(c);
			return deckCommunity_chest.remove(0); 
		}
	}
}
